---
layout: m1x_soap
title: Region List
---

<h2><a name="directory_region.list-RegionAPI"></a>Region API</h2>

<p>Allows you to export the list of regions from Magento</p>

<h2><a name="directory_region.list-Module%3AMageDirectory"></a>Module: Mage_Directory</h2>

<h3><a name="directory_region.list-Resource%3Adirectoryregion"></a>Resource: directory_region</h3>

<p><b>Aliases:</b></p>
<ul>
	<li>region</li>
</ul>


<h5><a name="directory_region.list-Method%3A"></a>Method:</h5>

<ul>
	<li>directory_region.list (SOAP V1)</li>
	<li>directoryRegionList (SOAP V2)</li>
</ul>


<p>Retrieve the list of regions in the specified country.</p>

<p><b>Aliases:</b></p>
<ul>
	<li>region.list</li>
</ul>


<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> country </td>
<td> Country code in ISO2 or ISO3 </td>
</tr>
</tbody></table>


<p><b>Returns:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> array </td>
<td> directoryRegionEntityArray <br class="atl-forced-newline" /> </td>
<td> An array of directoryRegionEntity </td>
</tr>
</tbody></table>



<p>The <b>directoryRegionEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> region_id </td>
<td> ID of the region </td>
</tr>
<tr>
<td> string </td>
<td> code </td>
<td> Region code </td>
</tr>
<tr>
<td> string </td>
<td> name </td>
<td> Name of the region </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 101 </td>
<td> Country not exists. </td>
</tr>
</tbody></table>


<h4><a name="directory_region.list-Examples"></a>Examples</h4>

<h5><a name="directory_region.list-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$regions = $proxy-&gt;call($sessionId, 'region.list', 'US');

var_dump($regions); // Region list for USA.</pre>
		</div>
</div></div>

<h5><a name="directory_region.list-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); 

$result = $proxy-&gt;directoryRegionList($sessionId,'US');
var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="directory_region.list-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;directoryRegionList((object)array('sessionId' =&gt; $sessionId-&gt;result, 'country' =&gt; 'US'));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>



<h5><a name="directory_region.list-ResponseExampleSOAPV1"></a>Response Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">array
  0 =&gt;
    array
      'region_id' =&gt; string '1' (length=1)
      'code' =&gt; string 'AL' (length=2)
      'name' =&gt; string 'Alabama' (length=7)
  1 =&gt;
    array
      'region_id' =&gt; string '2' (length=1)
      'code' =&gt; string 'AK' (length=2)
      'name' =&gt; string 'Alaska' (length=6)
  2 =&gt;
    array
      'region_id' =&gt; string '3' (length=1)
      'code' =&gt; string 'AS' (length=2)
      'name' =&gt; string 'American Samoa' (length=14)
  3 =&gt;
    array
      'region_id' =&gt; string '4' (length=1)
      'code' =&gt; string 'AZ' (length=2)
      'name' =&gt; string 'Arizona' (length=7)</pre>
		</div>
</div></div>


